import {
	apiResquest
} from '@/common/request.js'

//登录
export const userlogin = (query) => {
	return apiResquest({
		url: '/mobile/login/loginByPassword',
		method: 'POST',
		query,
		headers:{
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}
// 
export const logout = () => {
	return apiResquest({
		url: '/logout',
		method: 'POST',
	})
}
export const getUserInfo = () => {
	return apiResquest({
		url: '/system/user/profile',
		method: 'GET',
	})
}
export const uploadAvatar = (query) => {
	return apiResquest({
		url: '/system/user/profile/avatar',
		method: 'POST',
		query
	})
}
export const updatePwd = (oldPassword,newPassword) => {
	return apiResquest({
		url: `/system/user/profile/updatePwd?newPassword=${newPassword}&oldPassword=${oldPassword}`,
		method: 'PUT',
	})
}

